package com.lzjy.tw.composedemo.domain.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Transaction
import com.lzjy.tw.composedemo.domain.model.TestModel
import kotlinx.coroutines.flow.Flow

@Dao
interface TestDao {
    @Insert
    fun insert(model: TestModel)

    @Transaction
    @Query("SELECT * FROM test WHERE owner_id ==:owner_id")
    fun query(owner_id: Int): Flow<List<TestModel>>

    @Transaction
    @Query("SELECT * FROM test ")
    fun queryAll(): Flow<List<TestModel>>

}